package com.ycp.erp.main.fragment;

import android.os.Bundle;
import android.text.format.DateUtils;

import com.one.common.utils.TimeUtils;
import com.one.common.view.pagestate.listpage.BaseListFragment;
import com.ycp.erp.main.binder.EnterWarehouseRecordBinder;
import com.ycp.erp.main.binder.MoveWarehouseRecordBinder;
import com.ycp.erp.main.model.bean.WarehouseRecord;

import java.sql.Time;
import java.util.ArrayList;
import java.util.Date;

/**
 * Class Des:
 * Created by bjh on 2021/9/2.
 */
public class MoveWarehouseRecordFragment extends BaseListFragment {
    @Override
    protected void initPresenter() {

    }

    @Override
    public void registerDate() {
           register(WarehouseRecord.class,new MoveWarehouseRecordBinder());
    }

    @Override
    public void initData() {
        super.initData();
        loadData();
    }

    @Override
    public void loadData() {
        ArrayList<WarehouseRecord> warehouseRecords=new ArrayList<>();
        WarehouseRecord warehouseRecord = new WarehouseRecord();
        warehouseRecord.setAccount("测试账号");
        warehouseRecord.setDate(TimeUtils.getFormatDate(new Date(),"yyyy-MM-dd HH:mm:ss"));
        warehouseRecord.setFromWarehouseName("库1");
        warehouseRecord.setToWarehouseName("库e1");
        warehouseRecord.setRemark("");
        warehouseRecord.setGoodsNum("5");
        warehouseRecords.add(warehouseRecord);
        WarehouseRecord warehouseRecord1 = new WarehouseRecord();
        warehouseRecord1.setAccount("测试账号");
        warehouseRecord1.setDate(TimeUtils.getFormatDate(new Date(),"yyyy-MM-dd HH:mm:ss"));
        warehouseRecord1.setFromWarehouseName("库14");
        warehouseRecord1.setToWarehouseName("库144");
        warehouseRecord1.setRemark("sfsd");
        warehouseRecord1.setGoodsNum("5");
        warehouseRecords.add(warehouseRecord1);
        WarehouseRecord warehouseRecord2 = new WarehouseRecord();
        warehouseRecord2.setAccount("测试账号");
        warehouseRecord2.setDate(TimeUtils.getFormatDate(new Date(),"yyyy-MM-dd HH:mm:ss"));
        warehouseRecord2.setFromWarehouseName("库1e");
        warehouseRecord2.setToWarehouseName("库1");
        warehouseRecord2.setRemark("");
        warehouseRecord2.setGoodsNum("5");
        warehouseRecords.add(warehouseRecord2);
        WarehouseRecord warehouseRecord3 = new WarehouseRecord();
        warehouseRecord3.setAccount("测试账号");
        warehouseRecord3.setDate(TimeUtils.getFormatDate(new Date(),"yyyy-MM-dd HH:mm:ss"));
        warehouseRecord3.setFromWarehouseName("库1df");
        warehouseRecord3.setToWarehouseName("库1");
        warehouseRecord3.setRemark("");
        warehouseRecord3.setGoodsNum("5");
        warehouseRecords.add(warehouseRecord3);
        WarehouseRecord warehouseRecord4 = new WarehouseRecord();
        warehouseRecord4.setAccount("测试账号");
        warehouseRecord4.setDate(TimeUtils.getFormatDate(new Date(),"yyyy-MM-dd HH:mm:ss"));
        warehouseRecord4.setFromWarehouseName("库dfs");
        warehouseRecord4.setToWarehouseName("库f");
        warehouseRecord4.setRemark("");
        warehouseRecord4.setGoodsNum("5");
        warehouseRecords.add(warehouseRecord4);
        WarehouseRecord warehouseRecord5 = new WarehouseRecord();
        warehouseRecord5.setAccount("测试账号");
        warehouseRecord5.setDate(TimeUtils.getFormatDate(new Date(),"yyyy-MM-dd HH:mm:ss"));
        warehouseRecord5.setFromWarehouseName("库e");
        warehouseRecord5.setToWarehouseName("库5");
        warehouseRecord5.setRemark("");
        warehouseRecord5.setGoodsNum("5");
        warehouseRecords.add(warehouseRecord5);
        getAdapter().setItems(warehouseRecords);
        getAdapter().notifyDataSetChanged();
    }
    /**
     * 获取一个任务列表的实例
     */
    public static MoveWarehouseRecordFragment getInstance(String taskState) {
        MoveWarehouseRecordFragment fragment = new MoveWarehouseRecordFragment();
        Bundle bundle = new Bundle();
        bundle.putString("taskState", taskState);
        fragment.setArguments(bundle);
        return fragment;
    }
}
